package com.wbcs.system.datatype;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.wbcs.config.database.type.AbsDatabaseType;

public class ClobType extends AbsDataType
{
    private final static Log log=LogFactory.getLog(ClobType.class);

    public Object getColumnValue(ResultSet rs,String column,AbsDatabaseType dbtype)
            throws SQLException
    {
        return dbtype.getClobValue(rs,column);
    }

    public Object getColumnValue(ResultSet rs,int iindex,AbsDatabaseType dbtype)
            throws SQLException
    {
        return dbtype.getClobValue(rs,iindex);
    }

    public void setPreparedStatementValue(int iindex,String value,PreparedStatement pstmt,
            AbsDatabaseType dbtype) throws SQLException
    {
        log.debug("setClob("+iindex+","+value+")");
        dbtype.setClobValue(iindex,value,pstmt);
    }

    public Class getJavaTypeClass()
    {
        return String.class;
    }

    public Object label2value(String label)
    {
        return label;
    }
}
